package com.upc.cajabancos.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

public class LoginAction extends DispatchAction {
	
	/**
	 * Ingreso al sistema
	 * @author Cesar Jesus
	 * @since 29/01/2011
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward ingresar(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		
		System.out.println("Llego a ingresar");
		
		HttpSession httpSession = null;
		
		httpSession = request.getSession();
		
		if(request.isRequestedSessionIdValid()){
			httpSession.invalidate();
			request.getSession(true);
			
		}
		
		return mapping.findForward("principal");
	}

}
